<?php

require 'AipSpeech.php';
$appId  = "10483156";
$apiKey = "51fozfgAIAYMhV08ObWXAcqh"; 
$secretKey = "f747998496f8cb2640bf0d58bfb2eb82";
$api = new AipSpeech($appId,$apiKey,$secretKey);
$options    = [
    'per'=>1,
    'spd'=>6,
    'pit'=>7
    ];
$result = $api->synthesis('Hi,我是帅气辰的朋友悟空，他正在参加一个众筹学习的活动，他的成长进步需要您的参与，您的支持将是他前进的动力，赶快去支持他吧！','zh',1,$options);

if(!is_array($result)){
    file_put_contents(time().'.mp3', $result);
    echo "ok";
}else{
    echo "fail";
}


?>


